﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using LayoutPlanning.Model;

namespace LayoutPlanning.Views
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : Window
    {
        public MainView()
        {
            InitializeComponent();
        }


        private async void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            var b = ((sender as FrameworkElement)?.DataContext ?? this) as GraficalObject;
            if (b == null)
                return;
            ;
            b = await b.Copy();
            var a = sender as DependencyObject ?? this;
            DragDrop.DoDragDrop(a, b, DragDropEffects.Move);
        }

        private void worktasklistboxMouseClear(object sender, EventArgs mouseWheelEventArgs)
        {
            worktasklistbox.SelectedIndex = -1;
        }

        private void UIElement_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var listbox = sender as ListBox;
            if (listbox == null)
                return;
        }
    }
}